#include <bits/stdc++.h>
// 2025/02/25
// tag: 
// Author: Forever
using namespace std;

using int64 = int64_t;

int64 n, d[100001], s[100001];

void init(){
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> d[i];
    sort(d + 1, d + n + 1);
    for (int i = 1; i <= n; i++)
        s[i] = s[i - 1] + d[i];
}

signed main()
{
    int t;
    cin >> t;
    while (t--){
        init();
        int64 ans = 0;
        for (int i = 1; i <= n; i++)
            ans += d[i] * i - s[i];
        cout << d[n] - ans << endl;
    }
    return 0;
}